lst =[1,2,3,4,5,6,7,8,9,10]

list
# print(lst[1:3:1])
# print(lst[::-1])
#
# lst[3:3] = ["A","B"]
# print(lst)

import numbers
class Group:
    """
    实现一个可切片对象
    """
    def __init__(self,company_name,group_name,staffs):
        self.company_name = company_name
        self.group_name = group_name
        self.staffs = staffs

    def __getitem__(self, item):
        """
        :param item: 有可能是 int 或者 slice(None, 3, None)
        """
        cls = type(self)
        if isinstance(item,slice):
            staffs = self.staffs[item]
        else:
            staffs = [self.staffs[item]]

        return cls(self.company_name,self.group_name,staffs=staffs)
    def __len__(self):
        return len(self.staffs)
    def __reversed__(self):
        self.staffs.reverse()
    def __contains__(self, item):
        return item in self.staffs
    def __iter__(self):
        return iter(self.staffs)

group = Group("税友","小蚂蚁志愿者",["周三","马师傅","卡德隆","陈晨"])
for item in group[::2]:
    print(item)

print(len(group))
if "周三" in group:
    print("YES")
reversed(group)
print(group.staffs)
